package cn.bdqn.activity03;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class OneActivity extends AppCompatActivity {
private Button btnOne;
private TextView tvOne;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_one);
        btnOne=findViewById(R.id.btn_one);
        tvOne=findViewById(R.id.tv_one);
        tvOne.setText(this.toString());
        Toast.makeText(this,"two",Toast.LENGTH_SHORT).show();

        btnOne.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                /*Intent intent=new Intent(OneActivity.this,TwoActivity.class);
                startActivity(intent);*/

               /* Intent intent=new Intent();
                intent.setClass(OneActivity.this,TwoActivity.class);
                startActivity(intent);*/

               //隐式调用
                Intent intent=new Intent();
                intent.setPackage("cn.bdqn.activity03");
                intent.setAction("cn.bdqn.action.AAP_MAPS");
                startActivity(intent);
            }
        });
    }
}
